package server

import (
	"codeforces/src/task"
	"runtime"
)

func parse(inChan chan task.ITask, outChan chan task.ITask) {
	maxCpuNum := runtime.NumCPU()
	for i := 0; i < maxCpuNum; i++ {
		go func() {
			for task := range inChan {
				jsonString := task.GetParseFunc(task.Reader())
				task.SetResult(jsonString)
				outChan <- task
			}
		}()
	}

}
